package com.ecoolex.chinadutyfree.retailer.ws;

import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsOrder;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsOrderAfterSales;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsOrderAfterSalesRecord;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsOrderCoupon;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsOrderDetail;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsOrderIdentity;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsOrderReceiver;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsOrderSender;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsOrderShippedRecord;
import com.ecoolex.chinadutyfree.retailer.enums.DirectMailGoodsOrderStatus;
import com.ecoolex.chinadutyfree.retailer.pojo.DirectMailGoodsOrderChannelDTO;
import com.ecoolex.chinadutyfree.retailer.pojo.PreDirectMailGoodsOrderDTO;
import com.ecoolex.chinadutyfree.retailer.pojo.PreSubmitDirectMailGoodsOrderDTO;
import com.ecoolex.chinadutyfree.retailer.pojo.QueryDirectMailGoodsOrderAfterSalesDTO;
import com.ecoolex.chinadutyfree.retailer.pojo.QueryDirectMailGoodsOrderDTO;
import com.ecoolex.chinadutyfree.retailer.pojo.SubmitDirectMailGoodsOrderDTO;
import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.framework.common.pojo.Sorting;

import java.util.List;

public interface DirectMailGoodsOrderService {
	
	DirectMailGoodsOrder getOrderPossibleBeDeletedById(Integer orderId);
	
	Pagination<DirectMailGoodsOrder> query(QueryDirectMailGoodsOrderDTO query, Sorting[] sorts, Page page);

	DirectMailGoodsOrder getByOrderId(Integer orderId);
	
	DirectMailGoodsOrder refund(DirectMailGoodsOrder order,String reason,String updateUser) throws BizException;
	
	DirectMailGoodsOrderAfterSales confirmRefund(DirectMailGoodsOrderAfterSales afterSales, String updateUser) throws BizException;
	
	DirectMailGoodsOrderAfterSales refuseRefund(DirectMailGoodsOrderAfterSales afterSales,String auditOpinion, String updateUser) throws BizException;
	
	DirectMailGoodsOrderAfterSales confirmReturn(DirectMailGoodsOrderAfterSales afterSales, String updateUser) throws BizException;
	
	DirectMailGoodsOrderAfterSales refuseReturn(DirectMailGoodsOrderAfterSales afterSales,String auditOpinion, String updateUser) throws BizException;
	
	DirectMailGoodsOrderAfterSales confirmExchange(DirectMailGoodsOrderAfterSales afterSales, String updateUser) throws BizException;
	
	DirectMailGoodsOrderAfterSales refuseExchange(DirectMailGoodsOrderAfterSales afterSales,String auditOpinion, String updateUser) throws BizException;

	DirectMailGoodsOrderAfterSales confirmReceipt(DirectMailGoodsOrderAfterSales afterSales, String updateUser) throws BizException;
	
	DirectMailGoodsOrderAfterSales refuseReceipt(DirectMailGoodsOrderAfterSales afterSales,String reason, String updateUser) throws BizException;
	
	DirectMailGoodsOrder applyRefund(DirectMailGoodsOrder order,String reason,String evidenceImage, String updateUser) throws BizException;
	
	DirectMailGoodsOrder applyReturn(DirectMailGoodsOrder order,String reason,String evidenceImage, String updateUser) throws BizException;
	
	DirectMailGoodsOrder applyExchange(DirectMailGoodsOrder order,String reason,String evidenceImage, String updateUser) throws BizException;
	
	DirectMailGoodsOrder submitOrder(SubmitDirectMailGoodsOrderDTO submit, DirectMailGoodsOrderIdentity identity, DirectMailGoodsOrderChannelDTO channel, String createUser) throws BizException;

	PreDirectMailGoodsOrderDTO preSubmitOrder(PreSubmitDirectMailGoodsOrderDTO submit) throws BizException;

	void deleteOrder(DirectMailGoodsOrder order, String updateUser) throws BizException;

	DirectMailGoodsOrder getOrderByIdAndUserId(Integer orderId, Integer userId);

	DirectMailGoodsOrder getOrderByNoAndUserId(String orderNo, Integer userId);

	DirectMailGoodsOrder getOrderById(Integer orderId);

	Pagination<DirectMailGoodsOrder> queryUserData(Integer userId, List<String> status, Sorting[] sorts, Page page);

	List<DirectMailGoodsOrderDetail> queryOrderDetailByOrderId(Integer orderId);
	
	List<DirectMailGoodsOrderDetail> queryOrderDetailPossibleBeDeleted(Integer orderId);

	DirectMailGoodsOrderSender getSenderByOrderId(Integer orderId);
	
	DirectMailGoodsOrderSender getSenderPossibleBeDeletedByOrderId(Integer orderId);

	DirectMailGoodsOrderReceiver getReceiverByOrderId(Integer orderId);
	
	DirectMailGoodsOrderReceiver getReceiverPossibleBeDeletedByOrderId(Integer orderId);

	DirectMailGoodsOrderIdentity getIdentityByOrderId(Integer orderId);
	
	DirectMailGoodsOrderIdentity getIdentityPossibleBeDeletedByOrderId(Integer orderId);

	Long countTotalNumberByStatus(Integer userId, DirectMailGoodsOrderStatus status);

	Long countTotalNumberByStatus(Integer userId, List<DirectMailGoodsOrderStatus> status);

	DirectMailGoodsOrder cancel(DirectMailGoodsOrder order, String updateUser) throws BizException;

	// DirectMailGoodsOrder completeInfo(DirectMailGoodsOrder order, DirectMailGoodsOrderIdentity identity, String
	// updateUser) throws BizException;

	DirectMailGoodsOrder shipped(DirectMailGoodsOrder order, String updateUser) throws BizException;

	DirectMailGoodsOrder confirmReceipt(DirectMailGoodsOrder order, String updateUser) throws BizException;

	DirectMailGoodsOrderReceiver updateReceiver(DirectMailGoodsOrderReceiver receiver, String updateUser) throws BizException;

	DirectMailGoodsOrderSender updateSender(DirectMailGoodsOrderSender sender, String updateUser) throws BizException;

	DirectMailGoodsOrderSender addSender(DirectMailGoodsOrderSender sender, String createUser) throws BizException;

	void deleteSender(DirectMailGoodsOrderSender sender, String updateUser) throws BizException;

	DirectMailGoodsOrderIdentity updateDirectMailGoodsOrderIdentity(DirectMailGoodsOrderIdentity record,String updateUser) throws BizException;
	
	DirectMailGoodsOrderShippedRecord getShippedRecordById(Integer shippedRecordId);

	List<DirectMailGoodsOrderShippedRecord> queryShippedRecordByOrderId(Integer orderId);

	DirectMailGoodsOrderShippedRecord addShippedRecord(DirectMailGoodsOrder order, DirectMailGoodsOrderShippedRecord record, List<Integer> detailIdList, String createUser) throws BizException;

	DirectMailGoodsOrderShippedRecord updateShippedRecord(DirectMailGoodsOrderShippedRecord record, List<Integer> detailIdList, String updateUser) throws BizException;

	void deleteShippedRecord(DirectMailGoodsOrderShippedRecord record, String updateUser) throws BizException;

	List<DirectMailGoodsOrderAfterSalesRecord> afterSalesRecordList(Integer afterSalesId);
	
	List<DirectMailGoodsOrderAfterSalesRecord> afterSalesRecordListByOrderId(Integer orderId);
	
	DirectMailGoodsOrderAfterSales getAfterSalesPossibleBeDeletedByAfterSalesId(Integer afterSalesId);
	
	Pagination<DirectMailGoodsOrderAfterSales> queryDirectMailGoodsOrderAfterSales(QueryDirectMailGoodsOrderAfterSalesDTO query,Sorting[] sorts,Page page);
	
	DirectMailGoodsOrderAfterSales getDirectMailGoodsOrderAfterSalesByOrderId(Integer orderId);
	
	DirectMailGoodsOrderAfterSales getDirectMailGoodsOrderAfterSalesByAfterSalesId(Integer afterSalesId);
	
	DirectMailGoodsOrderAfterSales getDirectMailGoodsOrderAfterSalesByAfterSalesIdAndUserId(Integer afterSalesId,Integer userId);
	
	Pagination<DirectMailGoodsOrderAfterSales> queryDirectMailGoodsOrderAfterSalesForUser(Integer userId,Page page);
	
	DirectMailGoodsOrderAfterSales writeDeliveryNo(DirectMailGoodsOrderAfterSales afterSales,String deliveryNo,String updateUser) throws BizException;

	DirectMailGoodsOrderAfterSales cancelAfterSales(DirectMailGoodsOrderAfterSales afterSales,String updateUser) throws BizException;

	List<DirectMailGoodsOrderCoupon> queryOrderCouponByOrderId(Integer orderId);
}
